/*** 
 * @Date: 2020-07-10 09:55:09
 * @LastEditors: leehave
 * @LastEditTime: 2020-07-10 16:50:54
 */
import Vue from "vue";
import Vuex from "vuex";
import getters from "./getters";
Vue.use(Vuex);
import createLoadingPlugin from "@/utils/vuex-loading";
// 文件自动导入
const files = require.context('./modules', false, /\.js$/)
const modules = {}
files.keys().forEach(key => {
  modules[key.replace(/(\.\/|\.js)/g, '')] = files(key).default
})

export default new Vuex.Store({
  strict: false,
  plugins: [createLoadingPlugin()],
  modules,
  getters
});
